<?php $this->_extends('_layouts/cases_layout'); ?>

<?php $this->_block('contents'); ?>

<!-- 应用展示列表 -->
<?php foreach ($cases as $case): ?>

<div class="case-show">

  <div class="cases-thumb right">
    <a href="<?php echo url('cases/show', array('id' => $case->id())); ?>"><img src="<?php echo $_BASE_DIR . $case->thumb_src; ?>" class="thumb" /></a>
  </div>

  <div class="cases-title">
    <img src="<?php echo $_BASE_DIR; ?><?php echo $case->icon_src; ?>" />

    <h1<?php if (!$case->is_approbated): echo ' class="not-approbated"'; endif; ?>>
      <a href="<?php echo url('cases/show', array('id' => $case->id())); ?>"<?php if ($case->is_picked): ?> class="hot"<?php endif; ?>><?php echo h($case->title); ?></a>
      <?php if (!$case->is_approbated): ?><span class="not-approbated">等待审核</span><?php endif; ?>
      <?php if ($case->is_pending_delete): ?><span class="pending-delete">等待删除</span><?php endif; ?>
    </h1>

    <p>
      <?php if (isset($user['id']) && $user['id'] == $case->member_id): ?>
      作者：<?php echo h($case->owner->username); ?>
      , <a href="<?php echo url('cases/edit', array('id' => $case->id())); ?>" class="oper">修改应用展示</a>
      <?php else: ?>
      作者：<a href="<?php echo url('cases/index', array('type' => 'member', 'key' => $case->owner->username)); ?>"><?php echo h($case->owner->username); ?></a>
      <?php endif; ?>
    </p>
  </div>

  <div class="cases-contents">
    <ul class="meta">
      <li>添加日期：<strong><?php echo date('Y-m-d H:i', $case->created); ?></strong></li>
      <li>查看次数：<strong class="hot"><?php echo $case->clicks_count; ?></strong></li>
    </ul>

    <p class="contents">
	  <?php echo nl2br(h($case->summary)); ?>
	</p>

    <hr />
  </div>

</div>

<?php endforeach; ?>

<?php $this->_control('pagination', 'projects-pagination', array('pagination' => $pagination, 'url_args' => $pagination_args, 'show_count' => true)); ?>

<!-- /应用展示列表 -->

<?php $this->_endblock(); ?>

